program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  N, E, a, i: integer;    
  fin, fout: textfile;
begin
  assignfile(fin, 'input.txt');
  reset(fin);
  assignfile(fout, 'output.txt');
  rewrite(fout);
  E:=0;
  readln(fin, N);
  for i:=0 to N*N-1 do
  begin
    read(fin, a);
    E:=E+a;
  end;
  writeln(fout, E);
  closefile(fin);
  closefile(fout);
end.
 